package com.blog.log;

import org.apache.log4j.Logger;

/**
 * 获取系统中不变的文件属性
 * @author Administrator
 *
 */
public final class FinalProperty {
	static Logger log = Logger.getLogger(FinalProperty.class);
	private final String log4j_file_url="D:\\git\\cusblog\\blog\\target\\classes\\log4j\\log4j.properties";
	
	private final String log4j_RelativePath_name="log4j/log4j.properties";
	/**
	 * 获取固定的log4j配置文件在项目中的位置
	 * 
	 * @return
	 */
	public static String getLog4jurl(){
		FinalProperty log4j = new FinalProperty();
		System.out.println("手动配置的log4j配置文件地址为："+log4j.log4j_file_url);
		return log4j.log4j_file_url;
	}
	
	/**
	 * 
	 * @return log4j配置文件的相对路径+名（如：log4j/log4j.property）
	 */
	public static String getLogRelativePath(){
		//String RelativePath="log4j/";
		FinalProperty log4j = new FinalProperty();
		log.info("log4j的配置文件相对路径+名称为：："+log4j.log4j_RelativePath_name);
		return log4j.log4j_RelativePath_name;
	}
	public static void main(String[] args) {
		getLogRelativePath();
	}
	 
}
